from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token
from . import views
from rest_framework.routers import DefaultRouter

# router = DefaultRouter()

# router.register(r'addresses',views.UserAddressGenericView,base_name='address')

urlpatterns=[
    url(r'^usernames/(?P<username>\w{5,20})/count/$',views.RegisterUsernameCountAPIView.as_view(),name='username'),
    url(r'^mobile/(?P<mobile>1[345789]\d{9})/count/$',views.RegisterMobileCountAPIView.as_view(),name='mobile'),
    url(r'^$',views.RegisterCreateAPIView.as_view(),name='register'),
    # url(r'^auths/$', obtain_jwt_token, name='auths'),
    url(r'^auths/$', views.UserObtainJSONWebToken.as_view(), name='auths'),
    url(r'^infos/$', views.UserDetailAPIView.as_view(), name='userinfos'),
    url(r'^emails/$', views.UserEmailAPIView.as_view(), name='useremail'),
    url(r'^emails/verification/$', views.UserEmailVerificationAPIView.as_view(), name='useremail'),

    url(r'^addresses/$', views.UserAddressView.as_view(), name='addresses'),
    url(r'^addressesInfos/$', views.UserAddressInfosView.as_view(), name='listaddresses'),
    url(r'^addresses/(?P<pk>\d+)/$', views.UserAddressModifyView.as_view(), name='Modifyaddresses'),
    url(r'^addresses/(?P<pk>\d+)/status/$', views.SetDefaultAddressView.as_view(), name='defaultaddresses'),

    url(r'^browerhistories/$',views.BrowerHistoriesView.as_view(),name='browerhistory')


]

# urlpatterns += router.urls

